{% extends "learning_logs/base.html" %}

{% block header %}
    <h1>Topics</h1>
{% endblock header %}

{% block content %}

    <ul>
        {% for topic in topics %}
            <li>
                <h3>
                    <a href="{% url 'learning_logs:topic' topic.id %}">{{ topic }}</a>
                    {% if topic.owner == user %}
                        <small><a href="{% url 'learning_logs:delete_topic' topic.id %}" class="ex1"
                                  onclick="return confirm('永久删除此主题，请确认！');"> 删除</a></small>
                    {% endif %}
                </h3>
            </li>
        {% empty %}
            <li>No topics have been added yet.</li>
        {% endfor %}
    </ul>

    <h3><a href="{% url 'learning_logs:new_topic' %}">Add new topic</h3>

{% endblock content %}
